package com.micookie.v2ex.api;

/**
 * Created by Administrator on 2016/10/28.
 */

public class APIConfig {
    private static final boolean OPEN_HTTPS = true;

    private static final String URL_BASE = "www.v2ex.com";

    //相当于首页的“全部”这个 tab 下的最新内容。
    public static final String URL_TOPIC_LATEST = "/api/topics/latest.json";

    //相当于首页右侧的 10 大每天的内容。
    public static final String URL_TOPIC_HOT = "/api/topics/hot.json";

    //全部节点API
    public static final String URL_NODE_ALL = "/api/nodes/all.json";

    public static String getBaseUrl() {
        return (OPEN_HTTPS ? "https://" : "http://") + URL_BASE;
    }

    public static String getAllNodeUrl() {
        return getBaseUrl() + APIConfig.URL_NODE_ALL;
    }

    public static String getUrlTopicLatestUrl() {
        return getBaseUrl() + APIConfig.URL_TOPIC_LATEST;
    }

    public static String getUrlTopicHot() {
        return getBaseUrl() + APIConfig.URL_TOPIC_HOT;
    }

}
